import { Readable } from "node:stream";
import {util} from "qiniu";
import hmacSha1 = util.hmacSha1;

export function bufferToStream(buffer:Buffer) {
    return Readable.from(buffer)
}
export function getFileRealName(name:string){
    const prefix = name.indexOf('.')[1]
    return name==='blob' ? hmacSha1(new Date().getTime().toString()+'qiniu','dsfjlksjfdshFJJK'+'.'+prefix) : name
}